package com.atgm.mall.gmmallcart.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 游戏商品购物车
 */
@Data
@TableName(value = "cart_game_shopping")
public class GameShoppingEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.INPUT)
    private Long id;

    /**
     * 用户id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long memberId;

    /**
     * 商品id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long gameId;

    /**
     * 商品名称
     */
    private String gameName;

    /**
     * 商品默认图片
     */
    private String gameDefImg;

    /**
     * 是否选中；0：未选中；1：选中
     */
    private Integer isCheck;

    /**
     * 是否删除；0：未删除；1：删除
     */
    @TableLogic(value = "0", delval = "1")
    private Integer deleted;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
}
